export default {
  namespaced: true,
  state:{
    todoList:[]
  },
  mutations:{
    addTodo(state,option){
      console.log(arguments)
      state.todoList.push(option)
    },
    removeTodo(state,id){
      state.todoList = state.todoList.filter(item=>item.id!==id)
      // state.todoList.push(option)
    }
  },
  actions:{
    addTodoAsync(store,option){
      console.log(store.rootState)
      setTimeout(() => {
        store.commit('addTodo',option)
      }, 1000);
    }
  },
  getters:{}
}